Merge "Reduced the rate of RecentChangesUpdateJob insertion"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 18 May 2015 06:02:46 +0000 (06:02 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 18 May 2015 06:02:46 +0000 (06:02 +0000)
1  2 
includes/page/WikiPage.php

@@@ -2206,12 -2206,14 +2206,14 @@@ class WikiPage implements Page, IDBAcce
                Hooks::run( 'ArticleEditUpdates', array( &$this, &$editInfo, $options['changed'] ) );
  
                if ( Hooks::run( 'ArticleEditUpdatesDeleteFromRecentchanges', array( &$this ) ) ) {
-                       JobQueueGroup::singleton()->push( array(
-                               // Flush old entries from the `recentchanges` table
-                               RecentChangesUpdateJob::newPurgeJob(),
-                               // Update the cached list of active users
-                               RecentChangesUpdateJob::newCacheUpdateJob()
-                       ) );
+                       // Update the cached list of active users
+                       $jobs = array( RecentChangesUpdateJob::newCacheUpdateJob() );
+                       // Flush old entries from the `recentchanges` table
+                       if ( mt_rand( 0, 9 ) == 0 ) {
+                               $jobs[] = RecentChangesUpdateJob::newPurgeJob();
+                       }
+                       JobQueueGroup::singleton()->push( $jobs );
                }
  
                if ( !$this->exists() ) {
                                new JobSpecification( 'refreshLinks', $params,
                                        array( 'removeDuplicates' => true ), $this->mTitle )
                        ) );
 -                      return;
                }
 -
 -              return;
        }
  
        /**